const FORM_ITEM_LIST = [
  {
    prop: 'invoiceSupplierCode',
    label: '开票供应商代码',
    type: 'input',
  },
  {
    prop: 'invoiceSupplierNameOld',
    label: '开票供应商名称',
    type: 'input',
  },
  {
    prop: 'modifyPerson',
    label: '修改人',
    type: 'input',
  },
  {
    prop: 'modifyTime',
    label: '修改日期',
    type: 'datePicker',
  },
  /* {
    prop: 'createDate',
    label: '创建日期',
    type: 'datePicker',
  }, */
]
const initTableColumns = (parent) => {
  return [
    {
      title: '开票供应商代码',
      key: 'invoiceSupplierCode',
    },
    {
      title: '开票供应商名称',
      key: 'invoiceSupplierNameOld',
    },
    {
      title: '修改后名称',
      key: 'invoiceSupplierNameNew',
    },
    {
      title: '关系数量',
      key: 'relationNumber',
      render: (h, { row }) => {
        if (row.relationNumber > 0) {
          return <a onClick={() => { parent.handleViewLog(row) }}>{row.relationNumber}</a>
        }
        return <span>{row.relationNumber}</span>
      }
    },
    {
      title: '修改人',
      key: 'modifyPerson',
    },
    {
      title: '修改时间',
      key: 'modifyTime',
    },
    {
      title: '修改原因',
      key: 'reason',
    },
  ]
}

const BIND_TABLE_COLUMNS = [
  { key: 'index', title: '序号', width: 80 },
  { key: 'supplierCode', title: '供应商代码' },
  { key: 'supplierName', title: '供应商名称' },
  { key: 'invoiceSupplierCode', title: '开票供应商代码' },
  { key: 'invoiceSupplierName', title: '开票供应商名称' },
]
export {
  FORM_ITEM_LIST,
  initTableColumns,
  BIND_TABLE_COLUMNS,
}
